package com.ccdc.cbpc.bigdata.open.common.enums;

/**
 * 响应码枚举，参考HTTP状态码的语义
 * 来源模型平台并扩展
 * @author dong.zhang8
 * @date 2021-07-15
 */
public enum RespCodeEnum {
    CONTINUE(100,"继续请求"),//继续请求，可继续处理业务
    SUCCESS(200,"成功"),//成功
    MOVED(300,"资源过期"),//资源过期
    FAIL(400,"失败"),//失败
    UNAUTHORIZED(401,"未认证"),//未认证
    FORBIDDEN(403,"权限不足"),//权限不足
    NOT_FOUND(404,"资源不存在"),//接口不存在
    NOT_ALLOWED(405,"参数错误"),//参数错误
    SERVER_ERROR(500,"服务内部错误"),//服务器内部错误
    SERVER_DATA_ERROR(501,"服务内部(数据)错误"),//服务器内部错误
    SERVER_UNAVAILABLE(503,"服务不可用"),//外部服务不可用
    OTHER(600,"其他异常"),//外部服务不可用
    ;

    private final int code;
    private final String desc;
    RespCodeEnum(int code,String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
